// @ts-ignore
/* eslint-disable */
import request from '@/utils/request'

/** 上传头像 POST /api/user/avatar/upload */
export const uploadAvatarAPI = (data: FormData) => {
  return request({
    method: 'POST',
    url: '/api/user/avatar/upload',
    data,
  }) as API.BaseResponseString_
}

/** 获取当前登录用户信息 GET /api/user/currentUserInfo */
export async function getCurrentUserInfoUsingGet(options?: { [key: string]: any }) {
  return request<API.BaseResponseUserVo_>('/api/user/currentUserInfo', {
    method: 'GET',
    ...(options || {}),
  })
}

/** 批量删除用户 DELETE /api/user/delete */
export async function deleteUserUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteUserUsingDELETEParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/api/user/delete', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 根据ID删除单个用户 DELETE /api/user/delete/${param0}} */
export async function deleteUserByIdUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteUserByIdUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { userId: param0, ...queryParams } = params
  return request<API.BaseResponseBoolean_>(`/api/user/delete/${param0}}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 是否冻结用户 GET /api/user/freeze */
export async function freezeByUserIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.freezeByUserIdUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/api/user/freeze', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 根据ID查询用户 GET /api/user/getOne/${param0} */
export async function getUserByIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getUserByIdUsingGETParams,
  options?: { [key: string]: any },
) {
  const { userId: param0, ...queryParams } = params
  return request<API.BaseResponseUserVo_>(`/api/user/getOne/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 根据ID集合批量查询用户 GET /api/user/getUserList */
export async function getUserByIdListUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getUserByIdListUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseListUserVo_>('/api/user/getUserList', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 用户登录 POST /api/user/login */
export async function loginUsingPost(body: API.UserLoginDto, options?: { [key: string]: any }) {
  return request<API.BaseResponseUserLoginVo_>('/api/user/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 分页查询用户 POST /api/user/page */
export async function pageUsersUsingPost(
  body: API.UserPageRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsePageResultUserVo_>('/api/user/page', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 用户注册 POST /api/user/register */
export async function userRegisterUsingPost(
  body: API.UserRegisterRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseLong_>('/api/user/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 更新用户信息 POST /api/user/update */
export async function updateUsingPost(body: API.UserUpdateDto, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean_>('/api/user/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 管理员更新用户信息 POST /api/user/updateAdmin */
export async function updateByAdminUsingPost(
  body: API.UserUpdateAdminDto,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/api/user/updateAdmin', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}
